<?php
$this->Html->script('laksmi.admin.js', false);

$this->set('title_for_layout', 'Laksmi / Számlák');
?>
<div class="szamlak index">
<h2><?php echo __('Szamlak');?></h2>
<p>
<?php
print $this->Form->create('Szamla', array('action' => 'szamlatukor.xlsx'));
print $this->Form->submit('export.png', array(
											'class' => 'fr',
											'title' => 'Számlatükör exportálás xlsx-be'));
print $this->Form->end();
?>

<div class="actions">
	<ul>
		<li><?php echo $this->Html->link(__('Új Számla'), array('action'=>'add')); ?></li>
		<li><?php echo $this->Html->link(__('Számlatükör import'), array('action'=>'import')); ?></li>
	</ul>
</div>

<?php
print $this->Form->create('Szamla', array('action' => 'edit'));
print $this->Form->input('id',
								array(
									'label' => 'Számla',
									'type' => 'text',
									'value' => isset($this->request->data['Bizonylat']['Szamla']) ? $this->request->data['Bizonylat']['Szamla'] : false,
									'div' => false
									));
print $this->Form->end();

echo $this->Paginator->counter(array(
'format' => __('Page %page% of %pages%, showing %current% records out of %count% total, starting on record %start%, ending on %end%')
));
?></p>
<table cellpadding="0" cellspacing="0">
<tr>
	<th><?php echo $this->Paginator->sort('id');?></th>
	<th><?php echo $this->Paginator->sort('ceg_id');?></th>
	<th><?php echo $this->Paginator->sort('szam');?></th>
	<th><?php echo $this->Paginator->sort('nev');?></th>
	<th><?php echo $this->Paginator->sort('ev');?></th>
	<th class="actions"><?php echo __('Actions');?></th>
</tr>
<?php
$i = 0;
foreach ($szamlak as $szamla):
	$class = null;
	if ($i++ % 2 == 0) {
		$class = ' class="altrow"';
	}
?>
	<tr<?php echo $class;?>>
		<td>
			<?php echo $szamla['Szamla']['id']; ?>
		</td>
		<td>
			<?php echo $this->Html->link($szamla['Gyujto']['id'], array('controller'=> 'gyujtok', 'action'=>'view', $szamla['Gyujto']['id'])); ?>
		</td>
		<td>
			<?php echo $szamla['Szamla']['szam']; ?>
		</td>
		<td>
			<?php echo $szamla['Szamla']['nev']; ?>
		</td>
		<td>
			<?php echo $szamla['Szamla']['ev']; ?>
		</td>
		<td class="actions">
			<?php echo $this->Html->link(__('View'), array('action'=>'view', $szamla['Szamla']['id'])); ?>
			<?php echo $this->Html->link(__('Edit'), array('action'=>'edit', $szamla['Szamla']['id'])); ?>
			<?php echo $this->Html->link(__('Delete'), array('action'=>'delete', $szamla['Szamla']['id']), null, sprintf(__('Are you sure you want to delete # %s?'), $szamla['Szamla']['id'])); ?>
		</td>
	</tr>
<?php endforeach; ?>
</table>
</div>
<div class="paging">
	<?php echo $this->Paginator->prev('<< '.__('previous'), array(), null, array('class'=>'disabled'));?>
 | 	<?php echo $this->Paginator->numbers();?>
	<?php echo $this->Paginator->next(__('next').' >>', array(), null, array('class'=>'disabled'));?>
</div>
